@extends('home.parent')
@section('title','实名列表')
@section('head_js')
@endsection
@section('head_css')
<link rel="stylesheet" href="{{ asset('/css/dataTables.bootstrap.css') }}">
<link rel="stylesheet" href="{{ asset('/css/toggleButtonsMain.css') }}">
@endsection
@section('content')
<div class="content-wrapper">
    <section class="content-header">
        <h1>
            实名列表
			<small></small>
        </h1>
        <ol class="breadcrumb">
            <li>
                <a href="{{URL('admin')}}">
                    <i class="fa fa-dashboard"></i>首页
                </a>
            </li>
            <li class="active">实名列表</li>
        </ol>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <div class="form-inline pull-right">
                            <fieldset>
                                <div class="input-group input-group-sm">
                                    <span class="input-group-addon">
                                        <strong>用户</strong>
                                    </span>
                                    <input type="text" class="form-control" id="search_user">
                                </div>
                                <div class="input-group input-group-sm">
                                    <span class="input-group-addon">
                                        <strong>公司名字</strong>
                                    </span>
                                    <input type="text" class="form-control" id="search_company">
                                </div>
                                <div class="input-group input-group-sm">
                                    <span class="input-group-addon">
                                        <strong>联系人</strong>
                                    </span>
                                    <input type="text" class="form-control" id="search_name">
                                </div>
								<div class="input-group input-group-sm">
                                    <span class="input-group-addon">
                                        <strong>审核状态</strong>
                                    </span>
									<select class="form-control" id="search_status" style="width:150px;">
										<option value="99">全部</option>
										<option value="0">未审核</option>
										<option value="1">审核中</option>
										<option value="2">实名通过</option>
										<option value="-1">实名失败</option>
									</select>
                                </div>
                                <div class="input-group input-group-sm">
                                    <div class="input-group-btn">
                                        <button type="button" class="btn btn-primary" onclick="searchData()">
                                            <i class="fa fa-search"></i>
                                        </button>
                                    </div>
                                </div>
                            </fieldset>
                        </div>
                    </div>
                    <!--/.box-header-->
                    <div class="box-body">
                        <table id="data_list" class="table table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th>营业执照</th>
                                    <th>身份证正面</th>
                                    <th>身份证反面</th>
                                    <th>用户</th>
                                    <th>公司名字</th>
                                    <th>联系人</th>
                                    <th>备注</th>
                                    <th>操作者</th>
                                    <th>审核时间</th>
                                    <th>状态</th>
                                </tr>
                            </thead>
                            <tbody>
                            </tbody>
                            <tfoot>
                                <tr>
                                    <th>营业执照</th>
                                    <th>身份证正面</th>
                                    <th>身份证反面</th>
                                    <th>用户</th>
                                    <th>公司名字</th>
                                    <th>联系人</th>
                                    <th>备注</th>
                                    <th>操作者</th>
                                    <th>审核时间</th>
                                    <th>状态</th>
                                </tr>
                            </tfoot>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
@endsection
@section('foot_js')
<script src="{{ asset('/js/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('/js/dataTables.bootstrap.min.js') }}"></script>
<script src="{{ asset('/js/jquery.slimscroll.min.js') }}"></script>
<script src="{{ asset('/js/fastclick.js') }}"></script>
<script src="{{ asset('/js/tools.js') }}"></script>
<script>
var list_ajax;
$(function() {
    var lang = puppet.langShow();
    list_ajax = $("#data_list").dataTable({
        language: lang,
        autoWidth: false,
        stripeClasses: ["odd", "even"],
        processing: true,
        serverSide: true,
        searching: false,
        orderMulti: false,
        order: [[0, 'desc']],
        renderer: "bootstrap",
        pagingType: "simple_numbers",
        aLengthMenu: [5,10, 20, 50, 100],
        iDisplayLength: 5,
        columnDefs: [{
            "targets": [1, 2, 3, 4,5,6,7,8,9],
            "orderable": false
        },
        ],
        ajax: function(data, callback, settings) {
            var param = {};
            param.limit = data.length;
            param.start = data.start;
            param.page = (data.start / data.length) + 1;
            param.order = data.order;
            param.search_user = $.trim($("#search_user").val());
            param.search_company = $.trim($("#search_company").val());
            param.search_status = $.trim($("#search_status").val());
            param.search_name = $.trim($("#search_name").val());
            $.ajax({
                type: "POST",
                url: "{{ URL('real/list/searchAll') }}",
                cache: false,
                data: param,
                dataType: "json",
                success: function(result) {
                    var returnData = {};
                    returnData.draw = data.draw;
                    returnData.recordsTotal = result.total;
                    returnData.recordsFiltered = result.total;
                    returnData.data = result.data;
                    callback(returnData)
                }
            })
        },
        columns: [
            {"data": "Business_license"},
            {"data": "sfz_zm_url"},
            {"data": "sfz_fm_url"},
            {"data": "user_name"},
			{"data": "company"},
            {"data": "name"},
            {"data": "remark"},
            {"data": "operator"},
			{"data": "update_time"},
			{"data": "status"},
        ],
    }).api()
});
function searchData() {
    $("#data_list").dataTable().fnDraw(false);
    layer.msg("操作成功",{icon:6})
}
</script>
@endsection